package com.hsh.erp.controller;

import com.hsh.erp.domain.common.Result;
import com.hsh.erp.domain.dto.ExpressDTO;
import com.hsh.erp.domain.vo.ExpressVO;
import com.hsh.erp.service.ExpressService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;


/**
 * @author USER
 * @description 针对表【express_company】的数据库操作Service实现
 * @createDate 2024-05-30 15:59:00
 */
@RestController
@RequestMapping("/express")
@Tag(name = "快递", description = "快递")
public class ExpressController {

    @Resource
    private ExpressService expressService;

    /**
     * 列表查询
     *
     * @param expressVO
     * @return
     */
    @GetMapping("/list")
    @Operation(summary = "列表查询")
    public Result<List<ExpressDTO>> getList(ExpressVO expressVO) {
        return expressService.getList(expressVO);
    }

    /**
     * 修改一条记录
     *
     * @param expressVO
     * @return
     */
    @PostMapping("/updateOne")
    @Operation(summary = "修改一条记录")
    public Result updateOne(@RequestBody ExpressVO expressVO) {
        return expressService.updateOne(expressVO);
    }

    /**
     * 删除一条记录
     *
     * @param expressVO
     * @return
     */
    @PostMapping("/deleteOne")
    @Operation(summary = "删除一条记录")
    public Result deleteOne(@RequestBody ExpressVO expressVO) {
        return expressService.deleteOne(expressVO);
    }

    /**
     * 新增一条记录
     *
     * @param expressVO
     * @return
     */
    @PostMapping("/addOne")
    @Operation(summary = "新增一条记录")
    public Result addOne(@RequestBody ExpressVO expressVO) {
        return expressService.addOne(expressVO);
    }


}




